﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Xejen.Database.SqlSugar.Sqlite
{
    /// <summary>
    /// 表示适用于<see langword="Sqlite"/>的<see langword="SqlSugar"/>框架的数据库上下文
    /// </summary>
    /// <creator>marc</creator>
    public abstract class SqliteDbContext : SqlSugarClient
    {
        /// <inheritdoc cref="SqliteDbContext"/>
        /// <param name="connectionString">数据库连接字符串，如：Data Source=mydatabase.db</param>
        protected SqliteDbContext(string connectionString) : this(new ConnectionConfig
        {
            ConnectionString = connectionString,
            DbType = DbType.Sqlite,
            IsAutoCloseConnection = true,
            InitKeyType = InitKeyType.Attribute,
        })
        {

        }

        /// <inheritdoc cref="SqliteDbContext"/>
        protected SqliteDbContext(ConnectionConfig config) : base(config)
        {

        }

        /// <inheritdoc cref="SqliteDbContext"/>
        protected SqliteDbContext(List<ConnectionConfig> configs) : base(configs)
        {

        }

        /// <inheritdoc cref="SqliteDbContext"/>
        protected SqliteDbContext(ConnectionConfig config, Action<SqlSugarClient> configAction) : base(config, configAction)
        {

        }

        /// <inheritdoc cref="SqliteDbContext"/>
        protected SqliteDbContext(List<ConnectionConfig> configs, Action<SqlSugarClient> configAction) : base(configs, configAction)
        {

        }
    }
}
